package com.candoit.webapps.pricing.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Embeddable
public class DescuentoFK implements Serializable {
	
	private static final long serialVersionUID = 3634023858427063041L;

	@ManyToOne
	@JoinColumn(name="id_linea", referencedColumnName="id")
	private Linea linea;
	
	@Column(name = "cantidad")
	private Double cantidad = 0.00d;

	public Linea getLinea() {
		return linea;
	}

	public void setLinea(Linea linea) {
		this.linea = linea;
	}

	public Double getCantidad() {
		return cantidad;
	}

	public void setCantidad(Double cantidad) {
		this.cantidad = cantidad;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof DescuentoFK && ((DescuentoFK)obj).getLinea().getId().equals(this.linea.getId()) && ((DescuentoFK)obj).cantidad.equals(this.cantidad)){
			return true;
		}else{
			return false;
		}
	}
	
	
	
	

}
